*/
if (smp_processor_id() == 0) {
#ifdef XEN
- cpu_data = alloc_xenheap_pages(PERCPU_PAGE_SIZE -
- PAGE_SIZE + get_order(NR_CPUS));
+ cpu_data = alloc_xenheap_pages(PERCPU_PAGE_SHIFT -
+ PAGE_SHIFT + get_order(NR_CPUS));
#else
cpu_data = __alloc_bootmem(PERCPU_PAGE_SIZE * NR_CPUS,
PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS));
//Huh? This seems to be used on ia64 even if !CONFIG_SMP
void smp_send_event_check_mask(cpumask_t mask)
{
- dummy();
+ printf("smp_send_event_check_mask called\n");
+ //dummy();
//send_IPI_mask(cpu_mask, EVENT_CHECK_VECTOR);
}
/* Can deadlock when called with interrupts disabled */
#ifdef XEN
- if (irqs_disabled()) panic("smp_call_function called with interrupts disabled\n");
+ if (irqs_disabled()) {
+ printk("smp_call_function called with interrupts disabled...");
+ printk("enabling interrupts\n");
+ local_irq_enable();
+ }
#else
WARN_ON(irqs_disabled());
#endif
if (wait)
atomic_set(&data.finished, 0);
+ printk("smp_call_function: about to spin_lock \n");
spin_lock(&call_lock);
+ printk("smp_call_function: done with spin_lock \n");
call_data = &data;
mb(); /* ensure store to call_data precedes setting of IPI_CALL_FUNC */
+ printk("smp_call_function: about to send_IPI \n");
send_IPI_allbutself(IPI_CALL_FUNC);
+ printk("smp_call_function: done with send_IPI \n");
/* Wait for response */
while (atomic_read(&data.started) != cpus)
cpu_relax();
call_data = NULL;
+ printk("smp_call_function: about to spin_unlock \n");
spin_unlock(&call_lock);
+ printk("smp_call_function: DONE WITH spin_unlock, returning \n");
return 0;
}
EXPORT_SYMBOL(smp_call_function);
#ifdef CONFIG_SMP /* ifdef XEN */
-#define SMP_DEBUG 0
+//#define SMP_DEBUG 0
+#define SMP_DEBUG 1
#if SMP_DEBUG
#define Dprintk(x...) printk(x)
PSCB(vcpu,pending_interruption) = 1;
}
+#if 0
/* Keir: I think you should unblock when an interrupt is pending. */
{
int running = test_bit(_VCPUF_running, &vcpu->vcpu_flags);
if ( running )
smp_send_event_check_cpu(vcpu->processor);
}
+#endif
}
void early_tick(VCPU *vcpu)
void ia64_mca_cpu_init(void *x) { }
void ia64_patch_mckinley_e9(unsigned long a, unsigned long b) { }
void ia64_patch_vtop(unsigned long a, unsigned long b) { }
-void hpsim_setup(char **x) { }
+void hpsim_setup(char **x)
+{
+#ifdef CONFIG_SMP
+ init_smp_config();
+#endif
+}
// called from mem_init... don't think s/w I/O tlb is needed in Xen
//void swiotlb_init(void) { } ...looks like it IS needed
printk("About to call ac_timer_init()\n");
ac_timer_init();
// init_xen_time(); ???
+
+#ifdef CONFIG_SMP
+ if ( opt_nosmp )
+ {
+ max_cpus = 0;
+ smp_num_siblings = 1;
+ //boot_cpu_data.x86_num_cores = 1;
+ }
+
+ smp_prepare_cpus(max_cpus);
+
+ /* We aren't hotplug-capable yet. */
+ //BUG_ON(!cpus_empty(cpu_present_map));
+ for_each_cpu ( i )
+ cpu_set(i, cpu_present_map);
+
+ //BUG_ON(!local_irq_is_enabled());
+
+printk("num_online_cpus=%d, max_cpus=%d\n",num_online_cpus(),max_cpus);
+ for_each_present_cpu ( i )
+ {
+ if ( num_online_cpus() >= max_cpus )
+ break;
+ if ( !cpu_online(i) ) {
+printk("About to call __cpu_up(%d)\n",i);
+ __cpu_up(i);
+ }
+ }
+
+ printk("Brought up %ld CPUs\n", (long)num_online_cpus());
+ smp_cpus_done(max_cpus);
+#endif
+
+
+ // FIXME: Should the following be swapped and moved later?
schedulers_start();
do_initcalls();
printk("About to call sort_main_extable()\n");